<script setup>
function getCurrentDateFormatted() {
  let now = new Date()
  let year = now.getFullYear()
  let month = ('0' + (now.getMonth() + 1)).slice(-2) // 月份从 0 开始，需要加 1
  let day = ('0' + now.getDate()).slice(-2)
  return `${year}/${month}/${day}`
}

</script>

<template>
  <div id="site-footer" class="footer-wrapper">
    <div class="footer-left">
      left
    </div>
    <div class="footer-main">
      <p class="copyright">
        copyright &copy;
        <a href="https://gitee.com/dkwd" target="_blank" rel="noopener noreferrer">
          xcatp
        </a>
      </p>
      <p>2025/1/16 - {{ getCurrentDateFormatted() }}</p>
    </div>
    <div class="footer-right">
      right
    </div>
  </div>
</template>

<style scoped lang="scss">
.footer-wrapper {
  width: 100%;
  // min-height: 100px;
  max-height: 200px;
  border-top: 1px solid var(--border-primary);
  padding: 20px 0;
  background-color: var(--site-footer-bgc);
  display: grid;
  grid-template-columns: 10% 80% 10%;
  grid-template-rows: 100%;
  color: #eae2dc;

  @media screen and (max-width: 768px) {
    grid-template-columns: 20% 60% 20%;
  }

}

.footer-right {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;

}

.footer-left {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  transition: color 0.3s ease-in-out;

  @media screen and (min-width: 578px) and (max-width: 768px) {
    align-items: flex-start;
    margin-left: 10px;
  }
  
  @media screen and (max-width: 576px) {
    align-items: flex-start;
    writing-mode: vertical-rl;
    text-orientation: sideways;
  }

  &:hover {
    color: rgb(255, 199, 161);
  }
}

.footer-main {
  width: 100%;
  height: 100%;
}

.footer-main p {
  width: fit-content;
  font-family: "Lato", "Arial", sans-serif;
  font-size: .8rem;
  margin: 5px auto;
  text-align: center;
}

.copyright {
  margin-top: 20px;
}

a {
  color: rgb(255, 253, 161);
  text-decoration: none;
  transition: color 0.3s ease-in-out;

  &:hover {
    color: rgb(255, 199, 161);
  }
}
</style>
